/*
 * swap.cpp
 *
 *  Created on: 2012-8-12
 *      Author: rhao
 */

// swap algorithm example
#include <iostream>
#include <algorithm>
using namespace std;

void swap(int &a, int &b) {
	int temp = a;
	a = b;
	b = temp;
	cout << "swaped!" << endl;
}

int main() {

	int x = 10, y = 20; // x:10 y:20
	swap(x, y); // x:20 y:10
	cout << x << y << endl;
	return 0;
}

